import { ref } from "vue"

export function useModal() {
  const visible = ref(false)

  /**
   * 显示弹出框
   */
  const showModal = () => {
    visible.value = true
  }

  /**
   * 隐藏模态框
   */
  const hideModal = () => {
    visible.value = false
  }

  return {
    visible,
    showModal,
    hideModal
  }
}
